package com.idheima.zuoye.zuoye3;

public class Test {
    public static void main(String[] args) {
        Fu dog = new Dog("哈士奇", "白色", "小哈", 2);
        if (dog instanceof Dog) {
            Dog dog1 = (Dog) dog;
            dog1.lookHome();
        }
        dog.eat();
        System.out.println("------------");
        Fu cat = new Cat("蓝猫", "蓝色", "小蓝", 1);
        if (cat instanceof Cat) {
            Cat cat1 = (Cat) cat;
            cat1.catchMouse();
        }
        cat.eat();
        System.out.println("------------");
        Fu hedgehog = new Hedgehog("中国", "绿色", "小团", 3);
        if (hedgehog instanceof Hedgehog) {
            Hedgehog hedgehog1 = (Hedgehog) hedgehog;
            hedgehog1.acting();
        }
        hedgehog.eat();
    }
}
